

package Swingdemo;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

class PanelDemo extends JFrame
{
	JPanel obj,JPanel;
	JLabel firstname,secondname;
	
	public PanelDemo()
	{
		obj = new JPanel();
		firstname = new JLabel("First name");
		secondname = new JLabel("second name");
		
		
		obj.add(firstname);
		obj.add(secondname);
		
		
		
		
		setTitle("JPanel Demo");
		setVisible(true);
		setBounds(100,100,400,400);
		add(obj);
		
	}
}



public class exercise {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		PanelDemo pobj = new PanelDemo();
	}

}
